// adapter/rest/CreateBookRequest.java
package com.library.bookservice.adapter.rest;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.time.LocalDate;

/**
 * 创建图书请求DTO
 */
public record CreateBookRequest(
        @NotBlank(message = "ISBN不能为空")
        String isbn,

        @NotBlank(message = "书名不能为空")
        String title,

        @NotBlank(message = "作者不能为空")
        String author,

        @NotBlank(message = "分类不能为空")
        String genre,

        @NotNull(message = "出版日期不能为空")
        LocalDate publicationDate,

        @NotNull(message = "总数量不能为空")
        @Positive(message = "总数量必须大于0")
        Integer totalCopies
) {}